Skip to content

Comments

fix(minifier): keep variables that are modified by typeof foo === 'object' && foo !== null compression (2)#13362

Merged
graphite-app[bot] merged 1 commit intomainfrom
08-29-fix_minifier_keep_variables_that_are_modified_by_typeof_foo_object_foo_null_compression_2_
Aug 29, 2025
Merged

fix(minifier): keep variables that are modified by typeof foo === 'object' && foo !== null compression (2)#13362
graphite-app[bot] merged 1 commit intomainfrom
08-29-fix_minifier_keep_variables_that_are_modified_by_typeof_foo_object_foo_null_compression_2_

Conversation

@sapphi-red
Copy link
Member

@sapphi-red sapphi-red commented Aug 28, 2025

typeof foo === 'object' && foo !== null compression was not keeping the reference information and that caused used variables to be removed, similar to #13290.

var bar = foo.bar;
if (typeof bar !== 'object' || bar === null) console.log('foo')

was compressed into

if (typeof foo.bar !== 'object' || bar === null) console.log('foo')

refs #13290

Copy link
Member Author

sapphi-red commented Aug 28, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@codspeed-hq
Copy link

codspeed-hq bot commented Aug 28, 2025

CodSpeed Instrumentation Performance Report

Merging #13362 will not alter performance

Comparing 08-29-fix_minifier_keep_variables_that_are_modified_by_typeof_foo_object_foo_null_compression_2_ (72468f9) with main (b53a294)1

Summary

✅ 38 untouched benchmarks

Footnotes

  1. No successful run was found on main (72468f9) during the generation of this report, so b53a294 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Aug 29, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented Aug 29, 2025

Merge activity

…bject' && foo !== null` compression (2) (#13362)

`typeof foo === 'object' && foo !== null` compression was not keeping the reference information and that caused used variables to be removed, similar to #13290.
```js
var bar = foo.bar;
if (typeof bar !== 'object' || bar === null) console.log('foo')
```
was compressed into
```js
if (typeof foo.bar !== 'object' || bar === null) console.log('foo')
```

refs #13290
@graphite-app graphite-app bot force-pushed the 08-29-feat_minifier_inline_top-level_variables_for_module_scripts branch from fe63e95 to 56d2da3 Compare August 29, 2025 02:48
@graphite-app graphite-app bot force-pushed the 08-29-fix_minifier_keep_variables_that_are_modified_by_typeof_foo_object_foo_null_compression_2_ branch from b1be28e to 72468f9 Compare August 29, 2025 02:48
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Aug 29, 2025
Base automatically changed from 08-29-feat_minifier_inline_top-level_variables_for_module_scripts to main August 29, 2025 02:53
@graphite-app graphite-app bot merged commit 72468f9 into main Aug 29, 2025
25 checks passed
@graphite-app graphite-app bot deleted the 08-29-fix_minifier_keep_variables_that_are_modified_by_typeof_foo_object_foo_null_compression_2_ branch August 29, 2025 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-minifier Area - Minifier C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant